using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;

namespace ICP_MS.Plugin.Experiment;

public class FormRatio : Form
{
	private ExperimentDatas experiment = null;

	private ExperimentDB db = null;

	private List<IsotopeRatio> internalRatios = new List<IsotopeRatio>();

	private List<IsotopeRatio> internalStandards = new List<IsotopeRatio>();

	private List<IsotopeRatio> externalStandards = new List<IsotopeRatio>();

	private ComboBox cbInternalSample = null;

	private ComboBox cbInternalStandard = null;

	private IContainer components = null;

	private Label label1;

	private Label label2;

	private ComboBox cbNumerator;

	private ComboBox cbDenominator;

	private Button btnAdd;

	private DataGridView dgvRatios;

	private GroupBox groupBox1;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;

	private DataGridViewTextBoxColumn colNumerator;

	private DataGridViewTextBoxColumn colDenominator;

	private TabControl tabControl1;

	private TabPage tabPage1;

	private TabPage tabPage2;

	private DbufferGrid dgvInternalIsotopes;

	private Button btnRemoveInternalStandars;

	private DbufferGrid dgvInternalStandards;

	private Label label6;

	private Button btnAddInternalStandards;

	private Label label7;

	private DataGridViewTextBoxColumn colInternalTechSymbol;

	private DataGridViewTextBoxColumn colInternalTechTech;

	private DbufferGrid dgvExternalStandards;

	private Label label3;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;

	private DataGridViewTextBoxColumn colInternalSymbol;

	private DataGridViewTextBoxColumn colInternalConcent;

	public FormRatio()
	{
		InitializeComponent();
	}

	private void FormRatio_Load(object sender, EventArgs e)
	{
		base.WindowState = FormWindowState.Maximized;
		InitRatios();
		BindRatios();
		BindInternalStandards();
		BindExternalStandards();
		experiment.isotopeChanged += experiment_isotopeChanged;
		ApplyResources();
	}

	private void BindInternalStandards()
	{
		internalRatios = new List<IsotopeRatio>();
		internalStandards = new List<IsotopeRatio>();
		foreach (IsotopeRatio isotopes in experiment.Ratios)
		{
			if (isotopes.Inter)
			{
				internalStandards.Add(isotopes);
			}
			else
			{
				internalRatios.Add(isotopes);
			}
		}
		if (internalStandards.Count == 0)
		{
			foreach (IsotopeRatio isotope in internalRatios)
			{
				isotope.Technique = "None";
			}
		}
		((DataGridView)(object)dgvInternalIsotopes).AutoGenerateColumns = false;
		((DataGridView)(object)dgvInternalStandards).AutoGenerateColumns = false;
		((DataGridView)(object)dgvInternalIsotopes).DataSource = internalRatios;
		((DataGridView)(object)dgvInternalStandards).DataSource = internalStandards;
	}

	private void ApplyResources()
	{
		Text = Lang.Txt("FormRatio.Title.Text");
		label1.Text = Lang.Txt("FormRatio.Columns.Numerator.Text") + Lang.Txt("FormRatio.Colons.Text");
		label2.Text = Lang.Txt("FormRatio.Columns.Denominator.Text") + Lang.Txt("FormRatio.Colons.Text");
		colDenominator.HeaderText = Lang.Txt("FormRatio.Columns.Denominator.Text");
		colNumerator.HeaderText = Lang.Txt("FormRatio.Columns.Numerator.Text");
		groupBox1.Text = Lang.Txt("FormRatio.GroupBox.AddRatio.Text");
		btnAdd.Text = Lang.Txt("FormRatio.Button.Add.Text");
		tabPage1.Text = Lang.Txt("FormRatio.Title.Text");
		tabPage2.Text = Lang.Txt("AddFormRatio.Text");
		label6.Text = Lang.Txt("AddFormRatio.Isotope");
		label7.Text = Lang.Txt("AddFormRatio.InternalStandardCorrection");
		label3.Text = Lang.Txt("AddFormRatio.ExternalCorrection");
		colInternalTechSymbol.HeaderText = Lang.Txt("AddFormRatio.Element");
		colInternalTechTech.HeaderText = Lang.Txt("AddFormRatio.Method");
		colInternalSymbol.HeaderText = Lang.Txt("AddFormRatio.Element");
		colInternalConcent.HeaderText = Lang.Txt("AddFormRatio.StandardValue");
		dataGridViewTextBoxColumn3.HeaderText = Lang.Txt("AddFormRatio.Element");
		dataGridViewTextBoxColumn4.HeaderText = Lang.Txt("AddFormRatio.StandardValue");
	}

	public void SetParams(ExperimentDatas experiment, ExperimentDB db)
	{
		this.experiment = experiment;
		this.db = db;
	}

	private string[] InitRatios()
	{
		cbNumerator.Items.Clear();
		cbDenominator.Items.Clear();
		IEnumerable<string> symbols = experiment.SelectIsotopes.Select((AnalyteIsotope isotope) => isotope.symbol);
		if (symbols != null)
		{
			ComboBox.ObjectCollection items = cbNumerator.Items;
			object[] items2 = symbols.ToArray();
			items.AddRange(items2);
			ComboBox.ObjectCollection items3 = cbDenominator.Items;
			items2 = symbols.ToArray();
			items3.AddRange(items2);
			return symbols.ToArray();
		}
		return null;
	}

	private void BindRatios()
	{
		dgvRatios.AutoGenerateColumns = false;
		if (dgvRatios.DataSource == null)
		{
			dgvRatios.DataSource = experiment.Ratios;
			return;
		}
		BindingContext[dgvRatios.DataSource].SuspendBinding();
		dgvRatios.DataSource = null;
		dgvRatios.DataSource = experiment.Ratios;
		BindingContext[dgvRatios.DataSource].ResumeBinding();
		experiment.SetupRatioResults();
		experiment.Dirty.RatiosDirty = true;
	}

	public void experiment_isotopeChanged(object sender, EventArgs e)
	{
		string[] symbols = InitRatios();
		experiment.Ratios.RemoveAll((IsotopeRatio ratio) => !symbols.Contains(ratio.DenominatorSym) || !symbols.Contains(ratio.NumeratorSym));
		BindRatios();
		experiment.Dirty.RatiosDirty = true;
		BindInternalStandards();
		BindExternalStandards();
	}

	private void btnAdd_Click(object sender, EventArgs e)
	{
		if (cbNumerator.SelectedItem == null || cbDenominator.SelectedItem == null)
		{
			MessageBox.Show(Lang.Txt("FormRatio.MessageBox.Info.SelectElement.Text"), Lang.Txt("AddFormRatio.Warn"), MessageBoxButtons.OK);
			return;
		}
		try
		{
			string symbol1 = cbNumerator.SelectedItem.ToString();
			string symbol2 = cbDenominator.SelectedItem.ToString();
			if (symbol1 == symbol2)
			{
				MessageBox.Show(Lang.Txt("FormRatio.MessageBox.Info.SelectDifferentElement.Text"), Lang.Txt("AddFormRatio.Warn"), MessageBoxButtons.OK);
				return;
			}
			AnalyteIsotope isotope2 = experiment.SelectIsotopes.Where((AnalyteIsotope isotope) => isotope.symbol == symbol1).First();
			AnalyteIsotope isotope3 = experiment.SelectIsotopes.Where((AnalyteIsotope isotope) => isotope.symbol == symbol2).First();
			if (experiment.Ratios.Exists((IsotopeRatio r) => r.NumeratorId == isotope2.id && r.NumeratorSym == isotope2.symbol && r.DenominatorId == isotope3.id && r.DenominatorSym == isotope3.symbol))
			{
				MessageBox.Show(Lang.Txt("FormRatio.MessageBox.Info.ExitedRatio.Text"), "提示", MessageBoxButtons.OK);
				return;
			}
			IsotopeRatio ratio = new IsotopeRatio
			{
				NumeratorId = isotope2.id,
				NumeratorSym = isotope2.symbol,
				NumeratorMass = isotope2.mass,
				DenominatorId = isotope3.id,
				DenominatorSym = isotope3.symbol,
				DenominatorMass = isotope3.mass,
				Name = isotope2.symbol + "/" + isotope3.symbol,
				Inter = false,
				Technique = "None"
			};
			experiment.Ratios.Add(ratio);
			BindRatios();
			BindExternalStandards();
			BindInternalStandards();
			experiment.Dirty.RatiosDirty = true;
		}
		catch
		{
			MessageBox.Show(Lang.Txt("FormRatio.MessageBox.Info.UnexistingRatio.Text"), "提示", MessageBoxButtons.OK);
		}
	}

	private void dgvRatios_KeyDown(object sender, KeyEventArgs e)
	{
		if (e.KeyCode == Keys.Delete && dgvRatios.SelectedRows.Count > 0)
		{
			DeleteSelectedRatios();
		}
	}

	private void dgvRatios_MouseDown(object sender, MouseEventArgs e)
	{
		if (dgvRatios.SelectedRows.Count > 0 && e.Button == MouseButtons.Right)
		{
			ContextMenu menu = new ContextMenu();
			menu.MenuItems.Add(Lang.Txt("FormRatio.Delete.Text"), delegate
			{
				DeleteSelectedRatios();
			});
			menu.Show(dgvRatios, e.Location);
		}
	}

	private void DeleteSelectedRatios()
	{
		List<IsotopeRatio> ratios = new List<IsotopeRatio>();
		foreach (DataGridViewRow row in dgvRatios.SelectedRows)
		{
			ratios.Add(experiment.Ratios[row.Index]);
		}
		foreach (IsotopeRatio ratio in ratios)
		{
			experiment.Ratios.Remove(ratio);
			IEnumerable<RatioResults> rr = experiment.RatioResults.Where((RatioResults rrs) => rrs.Numerator == ratio.NumeratorSym && rrs.Denominator == ratio.DenominatorSym);
			List<RatioResults> result = new List<RatioResults>();
			result.AddRange(rr);
			foreach (RatioResults r2 in result)
			{
				experiment.RatioResults.Remove(r2);
			}
			IEnumerable<RatioStatistics> stat = experiment.RatioStat.Where((RatioStatistics stats) => stats.Numerator == ratio.NumeratorSym && stats.Denominator == ratio.DenominatorSym);
			List<RatioStatistics> ratioStatsResults = new List<RatioStatistics>();
			ratioStatsResults.AddRange(ratioStatsResults);
			foreach (RatioStatistics r in ratioStatsResults)
			{
				experiment.RatioStat.Remove(r);
			}
		}
		BindRatios();
		BindExternalStandards();
		BindInternalStandards();
		experiment.OnRatioChanged();
	}

	private void FormRatio_FormClosing(object sender, FormClosingEventArgs e)
	{
		experiment.isotopeChanged -= experiment_isotopeChanged;
	}

	private void dgvInternalIsotopes_CurrentCellChanged(object sender, EventArgs e)
	{
		DbufferGrid dgv = (DbufferGrid)((sender is DbufferGrid) ? sender : null);
		if (((DataGridView)(object)dgv).CurrentCell == null || dgv.InCapture || ((DataGridView)(object)dgv).CurrentCell.ColumnIndex != colInternalTechTech.Index)
		{
			return;
		}
		int columnIndex = ((DataGridView)(object)dgv).CurrentCell.ColumnIndex;
		int rowIndex = ((DataGridView)(object)dgv).CurrentCell.RowIndex;
		cbInternalSample = new ComboBox();
		cbInternalSample.Parent = (Control)(object)dgv;
		Rectangle rect = ((DataGridView)(object)dgv).GetCellDisplayRectangle(columnIndex, rowIndex, cutOverflow: false);
		cbInternalSample.Left = rect.Left;
		cbInternalSample.Top = rect.Top;
		cbInternalSample.Width = rect.Width;
		cbInternalSample.Height = rect.Height;
		cbInternalSample.DropDownStyle = ComboBoxStyle.DropDownList;
		cbInternalSample.Items.Add("None");
		cbInternalSample.Items.Add("External");
		if (internalStandards.Count > 0)
		{
			foreach (IsotopeRatio standard in internalStandards)
			{
				cbInternalSample.Items.Add(standard.Name);
			}
		}
		cbInternalSample.SelectedItem = ((DataGridView)(object)dgv).CurrentCell.Value.ToString();
		cbInternalSample.SelectedIndexChanged += delegate
		{
			internalRatios[((DataGridView)(object)dgv).CurrentCell.RowIndex].Technique = cbInternalSample.SelectedItem.ToString();
			((DataGridView)(object)dgv).InvalidateCell(((DataGridView)(object)dgv).CurrentCell);
			BindExternalStandards();
		};
	}

	private void dgvInternalIsotopes_CellLeave(object sender, DataGridViewCellEventArgs e)
	{
		DisposeBoxes();
	}

	private void DisposeBoxes()
	{
		if (cbInternalSample != null)
		{
			cbInternalSample.Visible = false;
			if (cbInternalSample != null)
			{
				cbInternalSample.Dispose();
			}
			cbInternalSample = null;
		}
	}

	private void dgvInternalStandards_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
	{
		int columnIndex = e.ColumnIndex;
		int num = columnIndex;
		if (num == 2)
		{
		}
	}

	private void dgvInternalStandards_CellLeave(object sender, DataGridViewCellEventArgs e)
	{
		if (cbInternalStandard != null)
		{
			cbInternalStandard.Visible = false;
			cbInternalStandard.Dispose();
		}
	}

	private void btnAddInternalStandards_Click(object sender, EventArgs e)
	{
		if (((DataGridView)(object)dgvInternalIsotopes).SelectedCells == null || ((DataGridView)(object)dgvInternalIsotopes).SelectedCells.Count <= 0)
		{
			return;
		}
		List<int> rowIndexs = new List<int>();
		foreach (DataGridViewCell cell in ((DataGridView)(object)dgvInternalIsotopes).SelectedCells)
		{
			if (!rowIndexs.Contains(cell.RowIndex))
			{
				rowIndexs.Add(cell.RowIndex);
			}
		}
		foreach (int rowIndex in rowIndexs)
		{
			internalRatios[rowIndex].Inter = true;
			double num = db.GetAnalyteIsotopesBySymbol(internalRatios[rowIndex].NumeratorSym).First().abundance;
			double denum = db.GetAnalyteIsotopesBySymbol(internalRatios[rowIndex].DenominatorSym).First().abundance;
			internalRatios[rowIndex].STDCon = Math.Round(num / denum, 5);
		}
		BindInternalStandards();
	}

	private void btnRemoveInternalStandars_Click(object sender, EventArgs e)
	{
		if (((DataGridView)(object)dgvInternalStandards).SelectedCells == null || ((DataGridView)(object)dgvInternalStandards).SelectedCells.Count <= 0)
		{
			return;
		}
		List<int> rowIndexs = new List<int>();
		foreach (DataGridViewCell cell in ((DataGridView)(object)dgvInternalStandards).SelectedCells)
		{
			if (!rowIndexs.Contains(cell.RowIndex))
			{
				rowIndexs.Add(cell.RowIndex);
			}
		}
		foreach (int rowIndex in rowIndexs)
		{
			internalStandards[rowIndex].Inter = false;
			internalStandards[rowIndex].Technique = "None";
			internalRatios[rowIndex].STDCon = -1.0;
			IEnumerable<IsotopeRatio> referenceIsotopes = internalRatios.Where((IsotopeRatio isotope) => isotope.Technique == internalStandards[rowIndex].Name);
			foreach (IsotopeRatio isotope2 in referenceIsotopes)
			{
				isotope2.Technique = Lang.Txt("FormStandard.Istd.Technique.None.Text");
			}
		}
		BindInternalStandards();
	}

	public void SelectedChanged(object sender, EventArgs e)
	{
		DisposeBoxes();
	}

	private void BindExternalStandards()
	{
		externalStandards = new List<IsotopeRatio>();
		foreach (IsotopeRatio ratio in experiment.Ratios)
		{
			if (ratio.Technique == "External")
			{
				if (ratio.STDCon == -1.0)
				{
					double num = db.GetAnalyteIsotopesBySymbol(ratio.NumeratorSym).First().abundance;
					double denum = db.GetAnalyteIsotopesBySymbol(ratio.DenominatorSym).First().abundance;
					ratio.STDCon = Math.Round(num / denum, 5);
				}
				externalStandards.Add(ratio);
			}
		}
		((DataGridView)(object)dgvExternalStandards).AutoGenerateColumns = false;
		((DataGridView)(object)dgvExternalStandards).DataSource = externalStandards;
	}

	private void dgvInternalIsotopes_CellContentClick(object sender, DataGridViewCellEventArgs e)
	{
	}

	protected override void Dispose(bool disposing)
	{
		if (disposing && components != null)
		{
			components.Dispose();
		}
		base.Dispose(disposing);
	}

	private void InitializeComponent()
	{
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Expected O, but got Unknown
		//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f1: Expected O, but got Unknown
		//IL_0108: Unknown result type (might be due to invalid IL or missing references)
		//IL_0112: Expected O, but got Unknown
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
		this.label1 = new System.Windows.Forms.Label();
		this.label2 = new System.Windows.Forms.Label();
		this.cbNumerator = new System.Windows.Forms.ComboBox();
		this.cbDenominator = new System.Windows.Forms.ComboBox();
		this.btnAdd = new System.Windows.Forms.Button();
		this.dgvRatios = new System.Windows.Forms.DataGridView();
		this.colNumerator = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colDenominator = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.groupBox1 = new System.Windows.Forms.GroupBox();
		this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.tabControl1 = new System.Windows.Forms.TabControl();
		this.tabPage1 = new System.Windows.Forms.TabPage();
		this.tabPage2 = new System.Windows.Forms.TabPage();
		this.dgvInternalIsotopes = new DbufferGrid();
		this.colInternalTechSymbol = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colInternalTechTech = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.btnRemoveInternalStandars = new System.Windows.Forms.Button();
		this.dgvExternalStandards = new DbufferGrid();
		this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dgvInternalStandards = new DbufferGrid();
		this.colInternalSymbol = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colInternalConcent = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.label6 = new System.Windows.Forms.Label();
		this.label3 = new System.Windows.Forms.Label();
		this.btnAddInternalStandards = new System.Windows.Forms.Button();
		this.label7 = new System.Windows.Forms.Label();
		((System.ComponentModel.ISupportInitialize)this.dgvRatios).BeginInit();
		this.groupBox1.SuspendLayout();
		this.tabControl1.SuspendLayout();
		this.tabPage1.SuspendLayout();
		this.tabPage2.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.dgvInternalIsotopes).BeginInit();
		((System.ComponentModel.ISupportInitialize)this.dgvExternalStandards).BeginInit();
		((System.ComponentModel.ISupportInitialize)this.dgvInternalStandards).BeginInit();
		base.SuspendLayout();
		this.label1.AutoSize = true;
		this.label1.Location = new System.Drawing.Point(79, 41);
		this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.label1.Name = "label1";
		this.label1.Size = new System.Drawing.Size(45, 15);
		this.label1.TabIndex = 0;
		this.label1.Text = "分子:";
		this.label2.AutoSize = true;
		this.label2.Location = new System.Drawing.Point(79, 90);
		this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.label2.Name = "label2";
		this.label2.Size = new System.Drawing.Size(45, 15);
		this.label2.TabIndex = 1;
		this.label2.Text = "分母:";
		this.cbNumerator.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cbNumerator.FormattingEnabled = true;
		this.cbNumerator.Location = new System.Drawing.Point(200, 38);
		this.cbNumerator.Margin = new System.Windows.Forms.Padding(4);
		this.cbNumerator.Name = "cbNumerator";
		this.cbNumerator.Size = new System.Drawing.Size(140, 23);
		this.cbNumerator.TabIndex = 2;
		this.cbDenominator.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.cbDenominator.FormattingEnabled = true;
		this.cbDenominator.Location = new System.Drawing.Point(200, 82);
		this.cbDenominator.Margin = new System.Windows.Forms.Padding(4);
		this.cbDenominator.Name = "cbDenominator";
		this.cbDenominator.Size = new System.Drawing.Size(140, 23);
		this.cbDenominator.TabIndex = 3;
		this.btnAdd.Location = new System.Drawing.Point(437, 63);
		this.btnAdd.Margin = new System.Windows.Forms.Padding(4);
		this.btnAdd.Name = "btnAdd";
		this.btnAdd.Size = new System.Drawing.Size(100, 29);
		this.btnAdd.TabIndex = 4;
		this.btnAdd.Text = "添加";
		this.btnAdd.UseVisualStyleBackColor = true;
		this.btnAdd.Click += new System.EventHandler(btnAdd_Click);
		this.dgvRatios.AllowUserToAddRows = false;
		this.dgvRatios.AllowUserToDeleteRows = false;
		dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		this.dgvRatios.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
		this.dgvRatios.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		this.dgvRatios.Columns.AddRange(this.colNumerator, this.colDenominator);
		dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window;
		dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText;
		dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
		this.dgvRatios.DefaultCellStyle = dataGridViewCellStyle2;
		this.dgvRatios.Location = new System.Drawing.Point(4, 167);
		this.dgvRatios.Margin = new System.Windows.Forms.Padding(4);
		this.dgvRatios.Name = "dgvRatios";
		this.dgvRatios.RowHeadersWidth = 51;
		this.dgvRatios.RowTemplate.Height = 23;
		this.dgvRatios.Size = new System.Drawing.Size(748, 342);
		this.dgvRatios.TabIndex = 5;
		this.dgvRatios.KeyDown += new System.Windows.Forms.KeyEventHandler(dgvRatios_KeyDown);
		this.dgvRatios.MouseDown += new System.Windows.Forms.MouseEventHandler(dgvRatios_MouseDown);
		this.colNumerator.DataPropertyName = "NumeratorSym";
		this.colNumerator.HeaderText = "分子";
		this.colNumerator.MinimumWidth = 6;
		this.colNumerator.Name = "colNumerator";
		this.colNumerator.ReadOnly = true;
		this.colNumerator.Width = 200;
		this.colDenominator.DataPropertyName = "DenominatorSym";
		this.colDenominator.HeaderText = "分母";
		this.colDenominator.MinimumWidth = 6;
		this.colDenominator.Name = "colDenominator";
		this.colDenominator.ReadOnly = true;
		this.colDenominator.Width = 200;
		this.groupBox1.Controls.Add(this.btnAdd);
		this.groupBox1.Controls.Add(this.cbDenominator);
		this.groupBox1.Controls.Add(this.cbNumerator);
		this.groupBox1.Controls.Add(this.label2);
		this.groupBox1.Controls.Add(this.label1);
		this.groupBox1.Location = new System.Drawing.Point(7, 7);
		this.groupBox1.Margin = new System.Windows.Forms.Padding(4);
		this.groupBox1.Name = "groupBox1";
		this.groupBox1.Padding = new System.Windows.Forms.Padding(4);
		this.groupBox1.Size = new System.Drawing.Size(748, 152);
		this.groupBox1.TabIndex = 6;
		this.groupBox1.TabStop = false;
		this.groupBox1.Text = "添加同位素比率";
		this.dataGridViewTextBoxColumn1.HeaderText = "分子";
		this.dataGridViewTextBoxColumn1.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
		this.dataGridViewTextBoxColumn1.Width = 200;
		this.dataGridViewTextBoxColumn2.HeaderText = "分母";
		this.dataGridViewTextBoxColumn2.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
		this.dataGridViewTextBoxColumn2.Width = 200;
		this.tabControl1.Controls.Add(this.tabPage1);
		this.tabControl1.Controls.Add(this.tabPage2);
		this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
		this.tabControl1.Location = new System.Drawing.Point(0, 0);
		this.tabControl1.Name = "tabControl1";
		this.tabControl1.SelectedIndex = 0;
		this.tabControl1.Size = new System.Drawing.Size(1278, 606);
		this.tabControl1.TabIndex = 7;
		this.tabPage1.BackColor = System.Drawing.SystemColors.Control;
		this.tabPage1.Controls.Add(this.groupBox1);
		this.tabPage1.Controls.Add(this.dgvRatios);
		this.tabPage1.Location = new System.Drawing.Point(4, 25);
		this.tabPage1.Name = "tabPage1";
		this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
		this.tabPage1.Size = new System.Drawing.Size(1270, 577);
		this.tabPage1.TabIndex = 0;
		this.tabPage1.Text = "同位素比率";
		this.tabPage2.BackColor = System.Drawing.SystemColors.Control;
		this.tabPage2.Controls.Add((System.Windows.Forms.Control)(object)this.dgvInternalIsotopes);
		this.tabPage2.Controls.Add(this.btnRemoveInternalStandars);
		this.tabPage2.Controls.Add((System.Windows.Forms.Control)(object)this.dgvExternalStandards);
		this.tabPage2.Controls.Add((System.Windows.Forms.Control)(object)this.dgvInternalStandards);
		this.tabPage2.Controls.Add(this.label6);
		this.tabPage2.Controls.Add(this.label3);
		this.tabPage2.Controls.Add(this.btnAddInternalStandards);
		this.tabPage2.Controls.Add(this.label7);
		this.tabPage2.Location = new System.Drawing.Point(4, 25);
		this.tabPage2.Name = "tabPage2";
		this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
		this.tabPage2.Size = new System.Drawing.Size(1270, 577);
		this.tabPage2.TabIndex = 1;
		this.tabPage2.Text = "校正方法";
		((System.Windows.Forms.DataGridView)(object)this.dgvInternalIsotopes).AllowUserToAddRows = false;
		((System.Windows.Forms.DataGridView)(object)this.dgvInternalIsotopes).AllowUserToDeleteRows = false;
		((System.Windows.Forms.Control)(object)this.dgvInternalIsotopes).Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
		((System.Windows.Forms.DataGridView)(object)this.dgvInternalIsotopes).BackgroundColor = System.Drawing.SystemColors.Control;
		((System.Windows.Forms.DataGridView)(object)this.dgvInternalIsotopes).BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
		dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		((System.Windows.Forms.DataGridView)(object)this.dgvInternalIsotopes).ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3;
		((System.Windows.Forms.DataGridView)(object)this.dgvInternalIsotopes).ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		((System.Windows.Forms.DataGridView)(object)this.dgvInternalIsotopes).Columns.AddRange(this.colInternalTechSymbol, this.colInternalTechTech);
		this.dgvInternalIsotopes.HorCopy = false;
		((System.Windows.Forms.Control)(object)this.dgvInternalIsotopes).Location = new System.Drawing.Point(35, 32);
		((System.Windows.Forms.Control)(object)this.dgvInternalIsotopes).Margin = new System.Windows.Forms.Padding(4);
		((System.Windows.Forms.Control)(object)this.dgvInternalIsotopes).Name = "dgvInternalIsotopes";
		((System.Windows.Forms.DataGridView)(object)this.dgvInternalIsotopes).RowHeadersWidth = 51;
		((System.Windows.Forms.DataGridView)(object)this.dgvInternalIsotopes).RowTemplate.Height = 23;
		((System.Windows.Forms.Control)(object)this.dgvInternalIsotopes).Size = new System.Drawing.Size(287, 524);
		((System.Windows.Forms.Control)(object)this.dgvInternalIsotopes).TabIndex = 15;
		this.dgvInternalIsotopes.VerCopy = true;
		((System.Windows.Forms.DataGridView)(object)this.dgvInternalIsotopes).CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(dgvInternalIsotopes_CellContentClick);
		((System.Windows.Forms.DataGridView)(object)this.dgvInternalIsotopes).CellLeave += new System.Windows.Forms.DataGridViewCellEventHandler(dgvInternalIsotopes_CellLeave);
		((System.Windows.Forms.DataGridView)(object)this.dgvInternalIsotopes).CurrentCellChanged += new System.EventHandler(dgvInternalIsotopes_CurrentCellChanged);
		this.colInternalTechSymbol.DataPropertyName = "Name";
		this.colInternalTechSymbol.HeaderText = "符号";
		this.colInternalTechSymbol.MinimumWidth = 6;
		this.colInternalTechSymbol.Name = "colInternalTechSymbol";
		this.colInternalTechSymbol.ReadOnly = true;
		this.colInternalTechSymbol.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.colInternalTechSymbol.Width = 120;
		this.colInternalTechTech.DataPropertyName = "Technique";
		this.colInternalTechTech.HeaderText = "方法";
		this.colInternalTechTech.MinimumWidth = 6;
		this.colInternalTechTech.Name = "colInternalTechTech";
		this.colInternalTechTech.Resizable = System.Windows.Forms.DataGridViewTriState.True;
		this.colInternalTechTech.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.colInternalTechTech.Width = 120;
		this.btnRemoveInternalStandars.Location = new System.Drawing.Point(351, 295);
		this.btnRemoveInternalStandars.Margin = new System.Windows.Forms.Padding(4);
		this.btnRemoveInternalStandars.Name = "btnRemoveInternalStandars";
		this.btnRemoveInternalStandars.Size = new System.Drawing.Size(43, 29);
		this.btnRemoveInternalStandars.TabIndex = 20;
		this.btnRemoveInternalStandars.Text = "&<<";
		this.btnRemoveInternalStandars.UseVisualStyleBackColor = true;
		this.btnRemoveInternalStandars.Click += new System.EventHandler(btnRemoveInternalStandars_Click);
		((System.Windows.Forms.DataGridView)(object)this.dgvExternalStandards).AllowUserToAddRows = false;
		((System.Windows.Forms.DataGridView)(object)this.dgvExternalStandards).AllowUserToDeleteRows = false;
		((System.Windows.Forms.Control)(object)this.dgvExternalStandards).Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
		((System.Windows.Forms.DataGridView)(object)this.dgvExternalStandards).BackgroundColor = System.Drawing.SystemColors.Control;
		((System.Windows.Forms.DataGridView)(object)this.dgvExternalStandards).BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
		dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		((System.Windows.Forms.DataGridView)(object)this.dgvExternalStandards).ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
		((System.Windows.Forms.DataGridView)(object)this.dgvExternalStandards).ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		((System.Windows.Forms.DataGridView)(object)this.dgvExternalStandards).Columns.AddRange(this.dataGridViewTextBoxColumn3, this.dataGridViewTextBoxColumn4);
		this.dgvExternalStandards.HorCopy = false;
		((System.Windows.Forms.Control)(object)this.dgvExternalStandards).Location = new System.Drawing.Point(735, 32);
		((System.Windows.Forms.Control)(object)this.dgvExternalStandards).Margin = new System.Windows.Forms.Padding(4);
		((System.Windows.Forms.Control)(object)this.dgvExternalStandards).Name = "dgvExternalStandards";
		((System.Windows.Forms.DataGridView)(object)this.dgvExternalStandards).RowHeadersWidth = 51;
		((System.Windows.Forms.DataGridView)(object)this.dgvExternalStandards).RowTemplate.Height = 23;
		((System.Windows.Forms.Control)(object)this.dgvExternalStandards).Size = new System.Drawing.Size(286, 524);
		((System.Windows.Forms.Control)(object)this.dgvExternalStandards).TabIndex = 17;
		this.dgvExternalStandards.VerCopy = true;
		((System.Windows.Forms.DataGridView)(object)this.dgvExternalStandards).CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(dgvInternalStandards_CellFormatting);
		((System.Windows.Forms.DataGridView)(object)this.dgvExternalStandards).CellLeave += new System.Windows.Forms.DataGridViewCellEventHandler(dgvInternalStandards_CellLeave);
		this.dataGridViewTextBoxColumn3.DataPropertyName = "Name";
		this.dataGridViewTextBoxColumn3.HeaderText = "符号";
		this.dataGridViewTextBoxColumn3.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
		this.dataGridViewTextBoxColumn3.ReadOnly = true;
		this.dataGridViewTextBoxColumn3.Width = 120;
		this.dataGridViewTextBoxColumn4.DataPropertyName = "STDCon";
		this.dataGridViewTextBoxColumn4.HeaderText = "标准值";
		this.dataGridViewTextBoxColumn4.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
		this.dataGridViewTextBoxColumn4.Width = 120;
		((System.Windows.Forms.DataGridView)(object)this.dgvInternalStandards).AllowUserToAddRows = false;
		((System.Windows.Forms.DataGridView)(object)this.dgvInternalStandards).AllowUserToDeleteRows = false;
		((System.Windows.Forms.Control)(object)this.dgvInternalStandards).Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
		((System.Windows.Forms.DataGridView)(object)this.dgvInternalStandards).BackgroundColor = System.Drawing.SystemColors.Control;
		((System.Windows.Forms.DataGridView)(object)this.dgvInternalStandards).BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
		dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		((System.Windows.Forms.DataGridView)(object)this.dgvInternalStandards).ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5;
		((System.Windows.Forms.DataGridView)(object)this.dgvInternalStandards).ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		((System.Windows.Forms.DataGridView)(object)this.dgvInternalStandards).Columns.AddRange(this.colInternalSymbol, this.colInternalConcent);
		this.dgvInternalStandards.HorCopy = false;
		((System.Windows.Forms.Control)(object)this.dgvInternalStandards).Location = new System.Drawing.Point(413, 32);
		((System.Windows.Forms.Control)(object)this.dgvInternalStandards).Margin = new System.Windows.Forms.Padding(4);
		((System.Windows.Forms.Control)(object)this.dgvInternalStandards).Name = "dgvInternalStandards";
		((System.Windows.Forms.DataGridView)(object)this.dgvInternalStandards).RowHeadersWidth = 51;
		((System.Windows.Forms.DataGridView)(object)this.dgvInternalStandards).RowTemplate.Height = 23;
		((System.Windows.Forms.Control)(object)this.dgvInternalStandards).Size = new System.Drawing.Size(288, 524);
		((System.Windows.Forms.Control)(object)this.dgvInternalStandards).TabIndex = 17;
		this.dgvInternalStandards.VerCopy = true;
		((System.Windows.Forms.DataGridView)(object)this.dgvInternalStandards).CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(dgvInternalStandards_CellFormatting);
		((System.Windows.Forms.DataGridView)(object)this.dgvInternalStandards).CellLeave += new System.Windows.Forms.DataGridViewCellEventHandler(dgvInternalStandards_CellLeave);
		this.colInternalSymbol.DataPropertyName = "Name";
		this.colInternalSymbol.HeaderText = "符号";
		this.colInternalSymbol.MinimumWidth = 6;
		this.colInternalSymbol.Name = "colInternalSymbol";
		this.colInternalSymbol.ReadOnly = true;
		this.colInternalSymbol.Width = 120;
		this.colInternalConcent.DataPropertyName = "STDCon";
		this.colInternalConcent.HeaderText = "标准值";
		this.colInternalConcent.MinimumWidth = 6;
		this.colInternalConcent.Name = "colInternalConcent";
		this.colInternalConcent.Width = 120;
		this.label6.AutoSize = true;
		this.label6.Location = new System.Drawing.Point(32, 8);
		this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.label6.Name = "label6";
		this.label6.Size = new System.Drawing.Size(60, 15);
		this.label6.TabIndex = 16;
		this.label6.Text = "同位素:";
		this.label3.AutoSize = true;
		this.label3.Location = new System.Drawing.Point(732, 8);
		this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.label3.Name = "label3";
		this.label3.Size = new System.Drawing.Size(75, 15);
		this.label3.TabIndex = 18;
		this.label3.Text = "外部校正:";
		this.btnAddInternalStandards.Location = new System.Drawing.Point(351, 259);
		this.btnAddInternalStandards.Margin = new System.Windows.Forms.Padding(4);
		this.btnAddInternalStandards.Name = "btnAddInternalStandards";
		this.btnAddInternalStandards.Size = new System.Drawing.Size(43, 29);
		this.btnAddInternalStandards.TabIndex = 19;
		this.btnAddInternalStandards.Text = "&>>";
		this.btnAddInternalStandards.UseVisualStyleBackColor = true;
		this.btnAddInternalStandards.Click += new System.EventHandler(btnAddInternalStandards_Click);
		this.label7.AutoSize = true;
		this.label7.Location = new System.Drawing.Point(410, 8);
		this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.label7.Name = "label7";
		this.label7.Size = new System.Drawing.Size(75, 15);
		this.label7.TabIndex = 18;
		this.label7.Text = "内标校正:";
		base.AutoScaleDimensions = new System.Drawing.SizeF(8f, 15f);
		base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
		base.ClientSize = new System.Drawing.Size(1278, 606);
		base.Controls.Add(this.tabControl1);
		base.Margin = new System.Windows.Forms.Padding(4);
		base.Name = "FormRatio";
		base.ShowIcon = false;
		this.Text = "同位素比率";
		base.FormClosing += new System.Windows.Forms.FormClosingEventHandler(FormRatio_FormClosing);
		base.Load += new System.EventHandler(FormRatio_Load);
		((System.ComponentModel.ISupportInitialize)this.dgvRatios).EndInit();
		this.groupBox1.ResumeLayout(false);
		this.groupBox1.PerformLayout();
		this.tabControl1.ResumeLayout(false);
		this.tabPage1.ResumeLayout(false);
		this.tabPage2.ResumeLayout(false);
		this.tabPage2.PerformLayout();
		((System.ComponentModel.ISupportInitialize)this.dgvInternalIsotopes).EndInit();
		((System.ComponentModel.ISupportInitialize)this.dgvExternalStandards).EndInit();
		((System.ComponentModel.ISupportInitialize)this.dgvInternalStandards).EndInit();
		base.ResumeLayout(false);
	}
}
